Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add a query smart contract method #578

Merged

Conversation

nklincoln
Copy link
Contributor

Signed-off-by: [email protected] [email protected]

This PR adds the companion method of invokeSmartContract to expose the ability to querySmartContract from the blockchain object directly, thereby raising the ability to perform the call beyond a Fabric level interaction.

This will give Caliper testing the ability to:

  • explicitly perform a query using a deployed smart contract
  • explicitly perform a query by going direct to the ledger if the underlying DLT engine permits it

Copy link
Contributor

@aklenik aklenik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for this!
If the underlying adapter implementation doesn't support the function, then the obj.querySmartContract() call will result in an ugly error. We should handle this more gracefully:

  1. Either check whether the adapter has this method, and throw on the abstract class level.
  2. Or add the method implementation to every adapter, and make them throw a "not supported" error.

The second approach would make it clear that the adapter needs some improvement.

@aklenik aklenik self-assigned this Sep 9, 2019
@aklenik aklenik added PR/change requested The PR is blocked until the requested changes are applied PR/under review The PR is currently under review labels Sep 9, 2019
@aklenik aklenik added this to the v0.2.0 milestone Sep 9, 2019
@aklenik aklenik merged commit e1db1b5 into hyperledger-caliper:master Sep 11, 2019
@aklenik aklenik removed PR/change requested The PR is blocked until the requested changes are applied PR/under review The PR is currently under review labels Sep 11, 2019
@nklincoln nklincoln deleted the add-querysmartcontract branch September 12, 2019 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants